import React from 'react';
import { Icon ,Radio,List} from 'weaver-mobile';
import { getLabel } from '../../util/common';
import base from "../../util/base";
const RadioItem = Radio.RadioItem;

/**
 * 判断是否走分支
 */
export default class Main extends React.Component{
    constructor(){
        super();
        this.state = {flag : '0'};
    }
    render(){
        const {flag} = this.state;
        const options = [
            {key:'0',label:getLabel(507411,'流转至下一节点')},
            {key:'1',label:getLabel(507412,'进入加签环节')}
        ];
        return (
            <div>
                <div>{`${getLabel(507410,'请选择流转路径')}:`}</div>
                <div style={{'marginTop':'10px'}}>
                    <List>
                        {options.map(i => (
                            <RadioItem key={i.key} checked={flag === i.key} onChange={() => {
                                const v = i.key;
                                this.setState({flag:v});
                                const {changeSubmitParam} = base.wfOperateStore;
                                changeSubmitParam({'flowToNextFreeNode':v});
                            }}>
                                {i.label}
                            </RadioItem>
                        ))}
                    </List>
                </div>
            </div>
        )
    }
}
